package com.atguigu.gmall.list.client;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.list.SearchParam;
import com.atguigu.gmall.model.list.SearchResponseVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Description: TODO
 * @Author: Mr.Cao
 * @DateTime: 2021/10/14 11:25
 * BMW F750GS
 **/
@FeignClient("service-list")
@Component
public interface ListFeignClient {
    /**
     * sku 商品上架
     * */
    @PostMapping("api/list/inner/onSale/{skuId}")
     Result onSale(@PathVariable long skuId);

    /**
     * sku 商品下架
     * */
    @PostMapping("api/list/inner/cancelSale/{skuId}")
     Result cancelSale(@PathVariable long skuId);

    /**
     * sku商品 增加热度值
     * */
    @PutMapping("api/list/inner/incrHostScore/{skuId}/{score}")
     void incrHostScore(@PathVariable long skuId,@PathVariable long score);

    //开始搜索
    @PostMapping("/api/list/inner/search")
    SearchResponseVo search(@RequestBody SearchParam searchParam);
}
